package com.xq.shop.controller;


import com.xq.shop.dto.QueryDto;
import com.xq.shop.service.IOperationLogService;
import com.xq.shop.vo.OperationLogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import utils.BasePage;
import utils.BaseResult;

/**
 * <p>
 * 操作日志表 前端控制器
 * </p>
 *
 * @author gaoxiaojin
 * @since 2024-07-16
 */
@RestController
@RequestMapping("/operation/log")
public class OperationLogController {

    private final IOperationLogService operationLogService;

    @Autowired
    public OperationLogController(IOperationLogService operationLogService) {
        this.operationLogService = operationLogService;
    }

    @RequestMapping("/page")
    public BaseResult<BasePage<OperationLogVo>> query(@RequestBody QueryDto dto) {

        BaseResult<BasePage<OperationLogVo>> result = new BaseResult<>();
        BasePage<OperationLogVo> page = operationLogService.pageQuery(dto);
        result.initializeSuccess(page);
        return result;

    }
}
